<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LINE 1 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-1"></span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LINE 2 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LINE 6 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-6"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Module      :  System.Win32.Time</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Copyright   :  (c) Esa Ilari Vuokko, 2006</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- License     :  BSD-style (see the file LICENSE)</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Maintainer  :  Esa Ilari Vuokko &lt;ei@vuokko.info&gt;</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Stability   :  provisional</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- A collection of FFI declarations for interfacing with Win32 Time API.</span><span>
</span><span id="line-17"></span><span class="hs-comment">--</span><span>
</span><span id="line-18"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-19"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">System.Win32.Time</span><span>
</span><span id="line-20"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="hs-identifier">FILETIME</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-21"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-22"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">TIME_ZONE_INFORMATION</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-23"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">TimeZoneId</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-24"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getSystemTime</span><span>
</span><span id="line-25"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">setSystemTime</span><span>
</span><span id="line-26"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getSystemTimeAsFileTime</span><span>
</span><span id="line-27"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getLocalTime</span><span>
</span><span id="line-28"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">setLocalTime</span><span>
</span><span id="line-29"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getSystemTimeAdjustment</span><span>
</span><span id="line-30"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getTickCount</span><span>
</span><span id="line-31"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getLastInputInfo</span><span>
</span><span id="line-32"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getIdleTime</span><span>
</span><span id="line-33"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">setSystemTimeAdjustment</span><span>
</span><span id="line-34"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getTimeZoneInformation</span><span>
</span><span id="line-35"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">systemTimeToFileTime</span><span>
</span><span id="line-36"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">fileTimeToSystemTime</span><span>
</span><span id="line-37"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getFileTime</span><span>
</span><span id="line-38"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">setFileTime</span><span>
</span><span id="line-39"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">invalidFileTime</span><span>
</span><span id="line-40"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">fileTimeToLocalFileTime</span><span>
</span><span id="line-41"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">localFileTimeToFileTime</span><span>
</span><span id="line-42"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">queryPerformanceFrequency</span><span>
</span><span id="line-43"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">queryPerformanceCounter</span><span>
</span><span id="line-44"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">GetTimeFormatFlags</span><span>
</span><span id="line-45"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">lOCALE_NOUSEROVERRIDE</span><span>
</span><span id="line-46"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">lOCALE_USE_CP_ACP</span><span>
</span><span id="line-47"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">tIME_NOMINUTESORSECONDS</span><span>
</span><span id="line-48"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">tIME_NOSECONDS</span><span>
</span><span id="line-49"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">tIME_NOTIMEMARKER</span><span>
</span><span id="line-50"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">tIME_FORCE24HOURFORMAT</span><span>
</span><span id="line-51"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getTimeFormatEx</span><span>
</span><span id="line-52"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">getTimeFormat</span><span>
</span><span id="line-53"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">System.Win32.String</span><span>  </span><span class="hs-special">(</span><span> </span><span class="hs-identifier">peekTStringLen</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">withTString</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">System.Win32.Types</span><span>   </span><span class="hs-special">(</span><span> </span><span class="hs-identifier">BOOL</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">DDWORD</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">DWORD</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">HANDLE</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">LARGE_INTEGER</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">LCID</span><span>
</span><span id="line-57"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">LONG</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">LPCTSTR</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">LPCWSTR</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">LPTSTR</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">LPWSTR</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">UINT</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">WORD</span><span>
</span><span id="line-58"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">dwordsToDdword</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">ddwordToDwords</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">failIf</span><span>
</span><span id="line-59"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">failIfFalse_</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">failIf_</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">System.Win32.Utils</span><span>   </span><span class="hs-special">(</span><span> </span><span class="hs-identifier">trySized</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Control.Monad</span><span>    </span><span class="hs-special">(</span><span> </span><span class="hs-identifier">when</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">liftM3</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">liftM</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data.Word</span><span>        </span><span class="hs-special">(</span><span> </span><span class="hs-identifier">Word8</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Foreign</span><span>          </span><span class="hs-special">(</span><span> </span><span class="hs-identifier">Storable</span><span class="hs-special">(</span><span class="hs-identifier">sizeOf</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">alignment</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">peekByteOff</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">peek</span><span class="hs-special">,</span><span>
</span><span id="line-65"></span><span>                                   </span><span class="hs-identifier">pokeByteOff</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">poke</span><span class="hs-special">)</span><span>
</span><span id="line-66"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">Ptr</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">nullPtr</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">castPtr</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">plusPtr</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">advancePtr</span><span>
</span><span id="line-67"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">with</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">alloca</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">allocaBytes</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">copyArray</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Foreign.C</span><span>        </span><span class="hs-special">(</span><span> </span><span class="hs-identifier">CInt</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">CWchar</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-69"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">peekCWString</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">withCWStringLen</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">withCWString</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Foreign.Marshal.Utils</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">maybeWith</span><span class="hs-special">)</span><span class="hs-cpp">

#include &quot;windows_cconv.h&quot;
</span><span>
</span><span id="line-74"></span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span>
</span><span id="line-77"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-78"></span><span class="hs-comment">-- data types</span><span>
</span><span id="line-79"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span class="hs-keyword">newtype</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-identifier">DDWORD</span><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Show</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">Eq</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">Ord</span><span class="hs-special">)</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="hs-keyword">data</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-84"></span><span>    </span><span class="hs-identifier">wYear</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">wMonth</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">wDayOfWeek</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">wDay</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">wHour</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">wMinute</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">wSecond</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">wMilliseconds</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">WORD</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-85"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Show</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">Eq</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">Ord</span><span class="hs-special">)</span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span class="hs-keyword">data</span><span> </span><span class="hs-identifier">TIME_ZONE_INFORMATION</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">TIME_ZONE_INFORMATION</span><span>
</span><span id="line-88"></span><span>    </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">tziBias</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LONG</span><span>
</span><span id="line-89"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">tziStandardName</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-90"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">tziStandardDate</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span>
</span><span id="line-91"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">tziStandardBias</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LONG</span><span>
</span><span id="line-92"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">tziDaylightName</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-93"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">tziDaylightDate</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span>
</span><span id="line-94"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">tziDaylightBias</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LONG</span><span>
</span><span id="line-95"></span><span>    </span><span class="hs-special">}</span><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Show</span><span class="hs-special">,</span><span class="hs-identifier">Eq</span><span class="hs-special">,</span><span class="hs-identifier">Ord</span><span class="hs-special">)</span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span class="hs-keyword">data</span><span> </span><span class="hs-identifier">TimeZoneId</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">TzIdUnknown</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">TzIdStandard</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">TzIdDaylight</span><span>
</span><span id="line-98"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Show</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">Eq</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">Ord</span><span class="hs-special">)</span><span>
</span><span id="line-99"></span><span>
</span><span id="line-100"></span><span class="hs-keyword">data</span><span> </span><span class="hs-identifier">LASTINPUTINFO</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">LASTINPUTINFO</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Show</span><span class="hs-special">)</span><span>
</span><span id="line-101"></span><span>
</span><span id="line-102"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-103"></span><span class="hs-comment">-- Instances</span><span>
</span><span id="line-104"></span><span class="hs-comment">----------------------------------------------------------------</span><span>
</span><span id="line-105"></span><span>
</span><span id="line-106"></span><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier">Storable</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-107"></span><span>    </span><span class="hs-identifier">sizeOf</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">const</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-number">8</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-108"></span><span class="hs-pragma">{-# LINE 108 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-108"></span><span>    </span><span class="hs-identifier">alignment</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-number">4</span><span>
</span><span id="line-109"></span><span class="hs-pragma">{-# LINE 109 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-109"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-identifier">n</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-110"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">0</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-identifier">low</span><span>
</span><span id="line-111"></span><span class="hs-pragma">{-# LINE 111 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-111"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">4</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-identifier">hi</span><span>
</span><span id="line-112"></span><span class="hs-pragma">{-# LINE 112 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-112"></span><span>        </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">hi</span><span class="hs-special">,</span><span class="hs-identifier">low</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ddwordToDwords</span><span> </span><span class="hs-identifier">n</span><span>
</span><span id="line-113"></span><span>    </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-114"></span><span>        </span><span class="hs-identifier">low</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">0</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-115"></span><span class="hs-pragma">{-# LINE 115 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-115"></span><span>        </span><span class="hs-identifier">hi</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">4</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-116"></span><span class="hs-pragma">{-# LINE 116 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-116"></span><span>        </span><span class="hs-identifier">return</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">dwordsToDdword</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">hi</span><span class="hs-special">,</span><span class="hs-identifier">low</span><span class="hs-special">)</span><span>
</span><span id="line-117"></span><span>
</span><span id="line-118"></span><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier">Storable</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-119"></span><span>    </span><span class="hs-identifier">sizeOf</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-number">16</span><span class="hs-special">)</span><span>
</span><span id="line-120"></span><span class="hs-pragma">{-# LINE 120 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-120"></span><span>    </span><span class="hs-identifier">alignment</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-number">2</span><span>
</span><span id="line-121"></span><span class="hs-pragma">{-# LINE 121 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-121"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-identifier">st</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-122"></span><span>         </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">0</span><span class="hs-special">)</span><span class="hs-special">)</span><span>          </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">wYear</span><span> </span><span class="hs-identifier">st</span><span class="hs-special">)</span><span>
</span><span id="line-123"></span><span class="hs-pragma">{-# LINE 123 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-123"></span><span>         </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">2</span><span class="hs-special">)</span><span class="hs-special">)</span><span>         </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">wMonth</span><span> </span><span class="hs-identifier">st</span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span class="hs-pragma">{-# LINE 124 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-124"></span><span>         </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">4</span><span class="hs-special">)</span><span class="hs-special">)</span><span>     </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">wDayOfWeek</span><span> </span><span class="hs-identifier">st</span><span class="hs-special">)</span><span>
</span><span id="line-125"></span><span class="hs-pragma">{-# LINE 125 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-125"></span><span>         </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">6</span><span class="hs-special">)</span><span class="hs-special">)</span><span>           </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">wDay</span><span> </span><span class="hs-identifier">st</span><span class="hs-special">)</span><span>
</span><span id="line-126"></span><span class="hs-pragma">{-# LINE 126 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-126"></span><span>         </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">8</span><span class="hs-special">)</span><span class="hs-special">)</span><span>          </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">wHour</span><span> </span><span class="hs-identifier">st</span><span class="hs-special">)</span><span>
</span><span id="line-127"></span><span class="hs-pragma">{-# LINE 127 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-127"></span><span>         </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">10</span><span class="hs-special">)</span><span class="hs-special">)</span><span>        </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">wMinute</span><span> </span><span class="hs-identifier">st</span><span class="hs-special">)</span><span>
</span><span id="line-128"></span><span class="hs-pragma">{-# LINE 128 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-128"></span><span>         </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">12</span><span class="hs-special">)</span><span class="hs-special">)</span><span>        </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">wSecond</span><span> </span><span class="hs-identifier">st</span><span class="hs-special">)</span><span>
</span><span id="line-129"></span><span class="hs-pragma">{-# LINE 129 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-129"></span><span>         </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">14</span><span class="hs-special">)</span><span class="hs-special">)</span><span>  </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">wMilliseconds</span><span> </span><span class="hs-identifier">st</span><span class="hs-special">)</span><span>
</span><span id="line-130"></span><span class="hs-pragma">{-# LINE 130 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-130"></span><span>    </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-131"></span><span>        </span><span class="hs-identifier">year</span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">0</span><span class="hs-special">)</span><span class="hs-special">)</span><span>        </span><span class="hs-identifier">buf</span><span>
</span><span id="line-132"></span><span class="hs-pragma">{-# LINE 132 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-132"></span><span>        </span><span class="hs-identifier">month</span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">2</span><span class="hs-special">)</span><span class="hs-special">)</span><span>       </span><span class="hs-identifier">buf</span><span>
</span><span id="line-133"></span><span class="hs-pragma">{-# LINE 133 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-133"></span><span>        </span><span class="hs-identifier">dow</span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">4</span><span class="hs-special">)</span><span class="hs-special">)</span><span>   </span><span class="hs-identifier">buf</span><span>
</span><span id="line-134"></span><span class="hs-pragma">{-# LINE 134 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-134"></span><span>        </span><span class="hs-identifier">day</span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">6</span><span class="hs-special">)</span><span class="hs-special">)</span><span>         </span><span class="hs-identifier">buf</span><span>
</span><span id="line-135"></span><span class="hs-pragma">{-# LINE 135 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-135"></span><span>        </span><span class="hs-identifier">hour</span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">8</span><span class="hs-special">)</span><span class="hs-special">)</span><span>        </span><span class="hs-identifier">buf</span><span>
</span><span id="line-136"></span><span class="hs-pragma">{-# LINE 136 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-136"></span><span>        </span><span class="hs-identifier">mins</span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">10</span><span class="hs-special">)</span><span class="hs-special">)</span><span>      </span><span class="hs-identifier">buf</span><span>
</span><span id="line-137"></span><span class="hs-pragma">{-# LINE 137 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-137"></span><span>        </span><span class="hs-identifier">sec</span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">12</span><span class="hs-special">)</span><span class="hs-special">)</span><span>      </span><span class="hs-identifier">buf</span><span>
</span><span id="line-138"></span><span class="hs-pragma">{-# LINE 138 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-138"></span><span>        </span><span class="hs-identifier">ms</span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">14</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-139"></span><span class="hs-pragma">{-# LINE 139 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-139"></span><span>        </span><span class="hs-identifier">return</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span> </span><span class="hs-identifier">year</span><span> </span><span class="hs-identifier">month</span><span> </span><span class="hs-identifier">dow</span><span> </span><span class="hs-identifier">day</span><span> </span><span class="hs-identifier">hour</span><span> </span><span class="hs-identifier">mins</span><span> </span><span class="hs-identifier">sec</span><span> </span><span class="hs-identifier">ms</span><span>
</span><span id="line-140"></span><span>
</span><span id="line-141"></span><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier">Storable</span><span> </span><span class="hs-identifier">TIME_ZONE_INFORMATION</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-142"></span><span>    </span><span class="hs-identifier">sizeOf</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-number">172</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-143"></span><span class="hs-pragma">{-# LINE 143 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-143"></span><span>    </span><span class="hs-identifier">alignment</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-number">4</span><span>
</span><span id="line-144"></span><span class="hs-pragma">{-# LINE 144 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-144"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-identifier">tzi</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-145"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">0</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">tziBias</span><span> </span><span class="hs-identifier">tzi</span><span class="hs-special">)</span><span>
</span><span id="line-146"></span><span class="hs-pragma">{-# LINE 146 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-146"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">68</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">tziStandardDate</span><span> </span><span class="hs-identifier">tzi</span><span class="hs-special">)</span><span>
</span><span id="line-147"></span><span class="hs-pragma">{-# LINE 147 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-147"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">84</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">tziStandardBias</span><span> </span><span class="hs-identifier">tzi</span><span class="hs-special">)</span><span>
</span><span id="line-148"></span><span class="hs-pragma">{-# LINE 148 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-148"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">152</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">tziDaylightDate</span><span> </span><span class="hs-identifier">tzi</span><span class="hs-special">)</span><span>
</span><span id="line-149"></span><span class="hs-pragma">{-# LINE 149 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-149"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">168</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">tziDaylightBias</span><span> </span><span class="hs-identifier">tzi</span><span class="hs-special">)</span><span>
</span><span id="line-150"></span><span class="hs-pragma">{-# LINE 150 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-150"></span><span>        </span><span class="hs-identifier">write</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-number">4</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">tziStandardName</span><span> </span><span class="hs-identifier">tzi</span><span class="hs-special">)</span><span>
</span><span id="line-151"></span><span class="hs-pragma">{-# LINE 151 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-151"></span><span>        </span><span class="hs-identifier">write</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-number">88</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">tziDaylightName</span><span> </span><span class="hs-identifier">tzi</span><span class="hs-special">)</span><span>
</span><span id="line-152"></span><span class="hs-pragma">{-# LINE 152 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-152"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-153"></span><span>            </span><span class="hs-identifier">write</span><span> </span><span class="hs-identifier">buf_</span><span> </span><span class="hs-identifier">offset</span><span> </span><span class="hs-identifier">str</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">withCWStringLen</span><span> </span><span class="hs-identifier">str</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="hs-identifier">c_str</span><span class="hs-special">,</span><span class="hs-identifier">len</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-154"></span><span>                </span><span class="hs-identifier">when</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">len</span><span class="hs-operator">&gt;</span><span class="hs-number">31</span><span class="hs-special">)</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">fail</span><span> </span><span class="hs-string">&quot;Storable TIME_ZONE_INFORMATION.poke: Too long string.&quot;</span><span>
</span><span id="line-155"></span><span>                </span><span class="hs-keyword">let</span><span> </span><span class="hs-identifier">len'</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">len</span><span> </span><span class="hs-operator">*</span><span> </span><span class="hs-identifier">sizeOf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">undefined</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">CWchar</span><span class="hs-special">)</span><span>
</span><span id="line-156"></span><span>                    </span><span class="hs-identifier">start</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">advancePtr</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">castPtr</span><span> </span><span class="hs-identifier">buf_</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">offset</span><span class="hs-special">)</span><span>
</span><span id="line-157"></span><span>                    </span><span class="hs-identifier">end</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">advancePtr</span><span> </span><span class="hs-identifier">start</span><span> </span><span class="hs-identifier">len'</span><span>
</span><span id="line-158"></span><span>                </span><span class="hs-identifier">copyArray</span><span> </span><span class="hs-identifier">start</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">castPtr</span><span> </span><span class="hs-identifier">c_str</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">Word8</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">len'</span><span>
</span><span id="line-159"></span><span>                </span><span class="hs-identifier">poke</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">castPtr</span><span> </span><span class="hs-identifier">end</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-number">0</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">CWchar</span><span class="hs-special">)</span><span>
</span><span id="line-160"></span><span>
</span><span id="line-161"></span><span>    </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-162"></span><span>        </span><span class="hs-identifier">bias</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">0</span><span class="hs-special">)</span><span class="hs-special">)</span><span>         </span><span class="hs-identifier">buf</span><span>
</span><span id="line-163"></span><span class="hs-pragma">{-# LINE 163 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-163"></span><span>        </span><span class="hs-identifier">sdat</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">68</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-164"></span><span class="hs-pragma">{-# LINE 164 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-164"></span><span>        </span><span class="hs-identifier">sbia</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">84</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-165"></span><span class="hs-pragma">{-# LINE 165 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-165"></span><span>        </span><span class="hs-identifier">ddat</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">152</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-166"></span><span class="hs-pragma">{-# LINE 166 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-166"></span><span>        </span><span class="hs-identifier">dbia</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">168</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-167"></span><span class="hs-pragma">{-# LINE 167 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-167"></span><span>        </span><span class="hs-identifier">snam</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">peekCWString</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">plusPtr</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-number">4</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-168"></span><span class="hs-pragma">{-# LINE 168 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-168"></span><span>        </span><span class="hs-identifier">dnam</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">peekCWString</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">plusPtr</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-number">88</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-169"></span><span class="hs-pragma">{-# LINE 169 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-169"></span><span>        </span><span class="hs-identifier">return</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">TIME_ZONE_INFORMATION</span><span> </span><span class="hs-identifier">bias</span><span> </span><span class="hs-identifier">snam</span><span> </span><span class="hs-identifier">sdat</span><span> </span><span class="hs-identifier">sbia</span><span> </span><span class="hs-identifier">dnam</span><span> </span><span class="hs-identifier">ddat</span><span> </span><span class="hs-identifier">dbia</span><span>
</span><span id="line-170"></span><span>
</span><span id="line-171"></span><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier">Storable</span><span> </span><span class="hs-identifier">LASTINPUTINFO</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-172"></span><span>    </span><span class="hs-identifier">sizeOf</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">const</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-number">8</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-173"></span><span class="hs-pragma">{-# LINE 173 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-173"></span><span>    </span><span class="hs-identifier">alignment</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">sizeOf</span><span>
</span><span id="line-174"></span><span>    </span><span class="hs-identifier">poke</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">LASTINPUTINFO</span><span> </span><span class="hs-identifier">t</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-175"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">0</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-number">8</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">UINT</span><span class="hs-special">)</span><span>
</span><span id="line-176"></span><span class="hs-pragma">{-# LINE 176 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-176"></span><span>        </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">pokeByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">4</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-identifier">t</span><span>
</span><span id="line-177"></span><span class="hs-pragma">{-# LINE 177 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-177"></span><span>    </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">buf</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-178"></span><span>        </span><span class="hs-identifier">t</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">peekByteOff</span><span> </span><span class="hs-identifier">hsc_ptr</span><span> </span><span class="hs-number">4</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">buf</span><span>
</span><span id="line-179"></span><span class="hs-pragma">{-# LINE 179 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-179"></span><span>        </span><span class="hs-identifier">return</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">LASTINPUTINFO</span><span> </span><span class="hs-identifier">t</span><span>
</span><span id="line-180"></span><span>
</span><span id="line-181"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h GetSystemTime&quot;</span><span>
</span><span id="line-182"></span><span>    </span><span class="hs-identifier">c_GetSystemTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-183"></span><span class="hs-identifier">getSystemTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span>
</span><span id="line-184"></span><span class="hs-identifier">getSystemTime</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">res</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-185"></span><span>    </span><span class="hs-identifier">c_GetSystemTime</span><span> </span><span class="hs-identifier">res</span><span>
</span><span id="line-186"></span><span>    </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">res</span><span>
</span><span id="line-187"></span><span>
</span><span id="line-188"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h SetSystemTime&quot;</span><span>
</span><span id="line-189"></span><span>    </span><span class="hs-identifier">c_SetSystemTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">BOOL</span><span>
</span><span id="line-190"></span><span class="hs-identifier">setSystemTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span class="hs-identifier">setSystemTime</span><span> </span><span class="hs-identifier">st</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">with</span><span> </span><span class="hs-identifier">st</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">c_st</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">failIf_</span><span> </span><span class="hs-identifier">not</span><span> </span><span class="hs-string">&quot;setSystemTime: SetSystemTime&quot;</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-192"></span><span>    </span><span class="hs-identifier">c_SetSystemTime</span><span> </span><span class="hs-identifier">c_st</span><span>
</span><span id="line-193"></span><span>
</span><span id="line-194"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h GetSystemTimeAsFileTime&quot;</span><span>
</span><span id="line-195"></span><span>    </span><span class="hs-identifier">c_GetSystemTimeAsFileTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-196"></span><span class="hs-identifier">getSystemTimeAsFileTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">FILETIME</span><span>
</span><span id="line-197"></span><span class="hs-identifier">getSystemTimeAsFileTime</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">ret</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-198"></span><span>    </span><span class="hs-identifier">c_GetSystemTimeAsFileTime</span><span> </span><span class="hs-identifier">ret</span><span>
</span><span id="line-199"></span><span>    </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">ret</span><span>
</span><span id="line-200"></span><span>
</span><span id="line-201"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h GetLocalTime&quot;</span><span>
</span><span id="line-202"></span><span>    </span><span class="hs-identifier">c_GetLocalTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-203"></span><span class="hs-identifier">getLocalTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span>
</span><span id="line-204"></span><span class="hs-identifier">getLocalTime</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">res</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-205"></span><span>    </span><span class="hs-identifier">c_GetLocalTime</span><span> </span><span class="hs-identifier">res</span><span>
</span><span id="line-206"></span><span>    </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">res</span><span>
</span><span id="line-207"></span><span>
</span><span id="line-208"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h SetLocalTime&quot;</span><span>
</span><span id="line-209"></span><span>    </span><span class="hs-identifier">c_SetLocalTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">BOOL</span><span>
</span><span id="line-210"></span><span class="hs-identifier">setLocalTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-211"></span><span class="hs-identifier">setLocalTime</span><span> </span><span class="hs-identifier">st</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">with</span><span> </span><span class="hs-identifier">st</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">c_st</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">failIf_</span><span> </span><span class="hs-identifier">not</span><span> </span><span class="hs-string">&quot;setLocalTime: SetLocalTime&quot;</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-212"></span><span>    </span><span class="hs-identifier">c_SetLocalTime</span><span> </span><span class="hs-identifier">c_st</span><span>
</span><span id="line-213"></span><span>
</span><span id="line-214"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h GetSystemTimeAdjustment&quot;</span><span>
</span><span id="line-215"></span><span>    </span><span class="hs-identifier">c_GetSystemTimeAdjustment</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">BOOL</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">BOOL</span><span>
</span><span id="line-216"></span><span class="hs-identifier">getSystemTimeAdjustment</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Int</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">Int</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-217"></span><span class="hs-identifier">getSystemTimeAdjustment</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">ta</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">ti</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">enabled</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-218"></span><span>    </span><span class="hs-identifier">failIf_</span><span> </span><span class="hs-identifier">not</span><span> </span><span class="hs-string">&quot;getSystemTimeAdjustment: GetSystemTimeAdjustment&quot;</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-219"></span><span>        </span><span class="hs-identifier">c_GetSystemTimeAdjustment</span><span> </span><span class="hs-identifier">ta</span><span> </span><span class="hs-identifier">ti</span><span> </span><span class="hs-identifier">enabled</span><span>
</span><span id="line-220"></span><span>    </span><span class="hs-identifier">enabled'</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">enabled</span><span>
</span><span id="line-221"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="hs-identifier">enabled'</span><span>
</span><span id="line-222"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-223"></span><span>            </span><span class="hs-identifier">ta'</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">ta</span><span>
</span><span id="line-224"></span><span>            </span><span class="hs-identifier">ti'</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">ti</span><span>
</span><span id="line-225"></span><span>            </span><span class="hs-identifier">return</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">Just</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-identifier">ta'</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-identifier">ti'</span><span class="hs-special">)</span><span>
</span><span id="line-226"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="hs-identifier">return</span><span> </span><span class="hs-identifier">Nothing</span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h GetTickCount&quot;</span><span> </span><span class="hs-identifier">getTickCount</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-229"></span><span>
</span><span id="line-230"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h GetLastInputInfo&quot;</span><span>
</span><span id="line-231"></span><span>  </span><span class="hs-identifier">c_GetLastInputInfo</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">LASTINPUTINFO</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Bool</span><span>
</span><span id="line-232"></span><span class="hs-identifier">getLastInputInfo</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-233"></span><span class="hs-identifier">getLastInputInfo</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-234"></span><span>  </span><span class="hs-identifier">with</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">LASTINPUTINFO</span><span> </span><span class="hs-number">0</span><span class="hs-special">)</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">lii_p</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-235"></span><span>  </span><span class="hs-identifier">failIfFalse_</span><span> </span><span class="hs-string">&quot;GetLastInputInfo&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_GetLastInputInfo</span><span> </span><span class="hs-identifier">lii_p</span><span>
</span><span id="line-236"></span><span>  </span><span class="hs-identifier">LASTINPUTINFO</span><span> </span><span class="hs-identifier">lii</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">lii_p</span><span>
</span><span id="line-237"></span><span>  </span><span class="hs-identifier">return</span><span> </span><span class="hs-identifier">lii</span><span>
</span><span id="line-238"></span><span>
</span><span id="line-239"></span><span class="hs-identifier">getIdleTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Integer</span><span>
</span><span id="line-240"></span><span class="hs-identifier">getIdleTime</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-241"></span><span>  </span><span class="hs-identifier">lii</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">getLastInputInfo</span><span>
</span><span id="line-242"></span><span>  </span><span class="hs-identifier">now</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">getTickCount</span><span>
</span><span id="line-243"></span><span>  </span><span class="hs-identifier">return</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">now</span><span> </span><span class="hs-glyph">-</span><span> </span><span class="hs-identifier">lii</span><span>
</span><span id="line-244"></span><span>
</span><span id="line-245"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h SetSystemTimeAdjustment&quot;</span><span>
</span><span id="line-246"></span><span>    </span><span class="hs-identifier">c_SetSystemTimeAdjustment</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">DWORD</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">BOOL</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">BOOL</span><span>
</span><span id="line-247"></span><span class="hs-identifier">setSystemTimeAdjustment</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">Int</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-248"></span><span class="hs-identifier">setSystemTimeAdjustment</span><span> </span><span class="hs-identifier">ta</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-249"></span><span>    </span><span class="hs-identifier">failIf_</span><span> </span><span class="hs-identifier">not</span><span> </span><span class="hs-string">&quot;setSystemTimeAjustment: SetSystemTimeAdjustment&quot;</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-250"></span><span>        </span><span class="hs-identifier">c_SetSystemTimeAdjustment</span><span> </span><span class="hs-identifier">time</span><span> </span><span class="hs-identifier">disabled</span><span>
</span><span id="line-251"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-252"></span><span>        </span><span class="hs-special">(</span><span class="hs-identifier">time</span><span class="hs-special">,</span><span class="hs-identifier">disabled</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-identifier">ta</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-253"></span><span>            </span><span class="hs-identifier">Nothing</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-number">0</span><span class="hs-special">,</span><span class="hs-identifier">True</span><span class="hs-special">)</span><span>
</span><span id="line-254"></span><span>            </span><span class="hs-identifier">Just</span><span> </span><span class="hs-identifier">x</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-identifier">x</span><span class="hs-special">,</span><span class="hs-identifier">False</span><span class="hs-special">)</span><span>
</span><span id="line-255"></span><span>
</span><span id="line-256"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h GetTimeZoneInformation&quot;</span><span>
</span><span id="line-257"></span><span>    </span><span class="hs-identifier">c_GetTimeZoneInformation</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">TIME_ZONE_INFORMATION</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-258"></span><span class="hs-identifier">getTimeZoneInformation</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">TimeZoneId</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">TIME_ZONE_INFORMATION</span><span class="hs-special">)</span><span>
</span><span id="line-259"></span><span class="hs-identifier">getTimeZoneInformation</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">tzi</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-260"></span><span>    </span><span class="hs-identifier">tz</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">failIf</span><span> </span><span class="hs-special">(</span><span class="hs-operator">==</span><span class="hs-special">(</span><span class="hs-number">4294967295</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-string">&quot;getTimeZoneInformation: GetTimeZoneInformation&quot;</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-261"></span><span class="hs-pragma">{-# LINE 261 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-261"></span><span>        </span><span class="hs-identifier">c_GetTimeZoneInformation</span><span> </span><span class="hs-identifier">tzi</span><span>
</span><span id="line-262"></span><span>    </span><span class="hs-identifier">tzi'</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">tzi</span><span>
</span><span id="line-263"></span><span>    </span><span class="hs-identifier">return</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">flip</span><span> </span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">tzi'</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-identifier">tz</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-264"></span><span>        </span><span class="hs-special">(</span><span class="hs-number">0</span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">TzIdUnknown</span><span>
</span><span id="line-265"></span><span class="hs-pragma">{-# LINE 265 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-265"></span><span>        </span><span class="hs-special">(</span><span class="hs-number">1</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">TzIdStandard</span><span>
</span><span id="line-266"></span><span class="hs-pragma">{-# LINE 266 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-266"></span><span>        </span><span class="hs-special">(</span><span class="hs-number">2</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">TzIdDaylight</span><span>
</span><span id="line-267"></span><span class="hs-pragma">{-# LINE 267 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-267"></span><span>        </span><span class="hs-identifier">_</span><span>                               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">TzIdUnknown</span><span>   </span><span class="hs-comment">-- to remove warning</span><span>
</span><span id="line-268"></span><span>
</span><span id="line-269"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h SystemTimeToFileTime&quot;</span><span>
</span><span id="line-270"></span><span>    </span><span class="hs-identifier">c_SystemTimeToFileTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">BOOL</span><span>
</span><span id="line-271"></span><span class="hs-identifier">systemTimeToFileTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">FILETIME</span><span>
</span><span id="line-272"></span><span class="hs-identifier">systemTimeToFileTime</span><span> </span><span class="hs-identifier">s</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">with</span><span> </span><span class="hs-identifier">s</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">c_s</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">ret</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-273"></span><span>    </span><span class="hs-identifier">failIf_</span><span> </span><span class="hs-identifier">not</span><span> </span><span class="hs-string">&quot;systemTimeToFileTime: SystemTimeToFileTime&quot;</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-274"></span><span>        </span><span class="hs-identifier">c_SystemTimeToFileTime</span><span> </span><span class="hs-identifier">c_s</span><span> </span><span class="hs-identifier">ret</span><span>
</span><span id="line-275"></span><span>    </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">ret</span><span>
</span><span id="line-276"></span><span>
</span><span id="line-277"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h FileTimeToSystemTime&quot;</span><span>
</span><span id="line-278"></span><span>    </span><span class="hs-identifier">c_FileTimeToSystemTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">BOOL</span><span>
</span><span id="line-279"></span><span class="hs-identifier">fileTimeToSystemTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span>
</span><span id="line-280"></span><span class="hs-identifier">fileTimeToSystemTime</span><span> </span><span class="hs-identifier">s</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">with</span><span> </span><span class="hs-identifier">s</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">c_s</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">ret</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-281"></span><span>    </span><span class="hs-identifier">failIf_</span><span> </span><span class="hs-identifier">not</span><span> </span><span class="hs-string">&quot;fileTimeToSystemTime: FileTimeToSystemTime&quot;</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-282"></span><span>        </span><span class="hs-identifier">c_FileTimeToSystemTime</span><span> </span><span class="hs-identifier">c_s</span><span> </span><span class="hs-identifier">ret</span><span>
</span><span id="line-283"></span><span>    </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">ret</span><span>
</span><span id="line-284"></span><span>
</span><span id="line-285"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h GetFileTime&quot;</span><span>
</span><span id="line-286"></span><span>    </span><span class="hs-identifier">c_GetFileTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HANDLE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">BOOL</span><span>
</span><span id="line-287"></span><span class="hs-identifier">getFileTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HANDLE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">FILETIME</span><span class="hs-special">,</span><span class="hs-identifier">FILETIME</span><span class="hs-special">,</span><span class="hs-identifier">FILETIME</span><span class="hs-special">)</span><span>
</span><span id="line-288"></span><span class="hs-identifier">getFileTime</span><span> </span><span class="hs-identifier">h</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">crt</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">acc</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">wrt</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-289"></span><span>    </span><span class="hs-identifier">failIf_</span><span> </span><span class="hs-identifier">not</span><span> </span><span class="hs-string">&quot;getFileTime: GetFileTime&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_GetFileTime</span><span> </span><span class="hs-identifier">h</span><span> </span><span class="hs-identifier">crt</span><span> </span><span class="hs-identifier">acc</span><span> </span><span class="hs-identifier">wrt</span><span>
</span><span id="line-290"></span><span>    </span><span class="hs-identifier">liftM3</span><span> </span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">crt</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">acc</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">wrt</span><span class="hs-special">)</span><span>
</span><span id="line-291"></span><span>
</span><span id="line-292"></span><span class="hs-identifier">invalidFileTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">FILETIME</span><span>
</span><span id="line-293"></span><span class="hs-identifier">invalidFileTime</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-number">0</span><span>
</span><span id="line-294"></span><span>
</span><span id="line-295"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h SetFileTime&quot;</span><span>
</span><span id="line-296"></span><span>    </span><span class="hs-identifier">c_SetFileTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HANDLE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">BOOL</span><span>
</span><span id="line-297"></span><span class="hs-identifier">setFileTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">HANDLE</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-298"></span><span class="hs-identifier">setFileTime</span><span> </span><span class="hs-identifier">h</span><span> </span><span class="hs-identifier">crt</span><span> </span><span class="hs-identifier">acc</span><span> </span><span class="hs-identifier">wrt</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">withTime</span><span> </span><span class="hs-identifier">crt</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-299"></span><span>    </span><span class="hs-glyph">\</span><span class="hs-identifier">c_crt</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">withTime</span><span> </span><span class="hs-identifier">acc</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-300"></span><span>    </span><span class="hs-glyph">\</span><span class="hs-identifier">c_acc</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">withTime</span><span> </span><span class="hs-identifier">wrt</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-301"></span><span>    </span><span class="hs-glyph">\</span><span class="hs-identifier">c_wrt</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-302"></span><span>      </span><span class="hs-identifier">failIf_</span><span> </span><span class="hs-identifier">not</span><span> </span><span class="hs-string">&quot;setFileTime: SetFileTime&quot;</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_SetFileTime</span><span> </span><span class="hs-identifier">h</span><span> </span><span class="hs-identifier">c_crt</span><span> </span><span class="hs-identifier">c_acc</span><span> </span><span class="hs-identifier">c_wrt</span><span>
</span><span id="line-303"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-304"></span><span>    </span><span class="hs-identifier">withTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">a</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">a</span><span>
</span><span id="line-305"></span><span>    </span><span class="hs-identifier">withTime</span><span> </span><span class="hs-identifier">Nothing</span><span> </span><span class="hs-identifier">k</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">k</span><span> </span><span class="hs-identifier">nullPtr</span><span>
</span><span id="line-306"></span><span>    </span><span class="hs-identifier">withTime</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Just</span><span> </span><span class="hs-identifier">t</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">k</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">with</span><span> </span><span class="hs-identifier">t</span><span> </span><span class="hs-identifier">k</span><span>
</span><span id="line-307"></span><span>
</span><span id="line-308"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h FileTimeToLocalFileTime&quot;</span><span>
</span><span id="line-309"></span><span>    </span><span class="hs-identifier">c_FileTimeToLocalFileTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">BOOL</span><span>
</span><span id="line-310"></span><span class="hs-identifier">fileTimeToLocalFileTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">FILETIME</span><span>
</span><span id="line-311"></span><span class="hs-identifier">fileTimeToLocalFileTime</span><span> </span><span class="hs-identifier">ft</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">with</span><span> </span><span class="hs-identifier">ft</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">c_ft</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">res</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-312"></span><span>    </span><span class="hs-identifier">failIf_</span><span> </span><span class="hs-identifier">not</span><span> </span><span class="hs-string">&quot;fileTimeToLocalFileTime: FileTimeToLocalFileTime&quot;</span><span>
</span><span id="line-313"></span><span>        </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_FileTimeToLocalFileTime</span><span> </span><span class="hs-identifier">c_ft</span><span> </span><span class="hs-identifier">res</span><span>
</span><span id="line-314"></span><span>    </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">res</span><span>
</span><span id="line-315"></span><span>
</span><span id="line-316"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h LocalFileTimeToFileTime&quot;</span><span>
</span><span id="line-317"></span><span>    </span><span class="hs-identifier">c_LocalFileTimeToFileTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">BOOL</span><span>
</span><span id="line-318"></span><span class="hs-identifier">localFileTimeToFileTime</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">FILETIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">FILETIME</span><span>
</span><span id="line-319"></span><span class="hs-identifier">localFileTimeToFileTime</span><span> </span><span class="hs-identifier">ft</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">with</span><span> </span><span class="hs-identifier">ft</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">c_ft</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">res</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-320"></span><span>    </span><span class="hs-identifier">failIf_</span><span> </span><span class="hs-identifier">not</span><span> </span><span class="hs-string">&quot;localFileTimeToFileTime: LocalFileTimeToFileTime&quot;</span><span>
</span><span id="line-321"></span><span>        </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">c_LocalFileTimeToFileTime</span><span> </span><span class="hs-identifier">c_ft</span><span> </span><span class="hs-identifier">res</span><span>
</span><span id="line-322"></span><span>    </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">res</span><span>
</span><span id="line-323"></span><span>
</span><span id="line-324"></span><span class="hs-comment">{-
-- Windows XP SP1
foreign import WINDOWS_CCONV &quot;windows.h GetSystemTimes&quot;
    c_GetSystemTimes :: Ptr FILETIME -&gt; Ptr FILETIME -&gt; Ptr FILETIME -&gt; IO BOOL
getSystemTimes :: IO (FILETIME,FILETIME,FILETIME)
getSystemTimes = alloca $ \idle -&gt; alloca $ \kernel -&gt; alloca $ \user -&gt; do
    failIf not &quot;getSystemTimes: GetSystemTimes&quot; $ c_GetSystemTimes idle kernel user
    liftM3 (,,) (peek idle) (peek kernel) (peek user)
-}</span><span>
</span><span id="line-333"></span><span>
</span><span id="line-334"></span><span class="hs-comment">{-
-- Windows XP
foreign import WINDOWS_CCONV &quot;windows.h SystemTimeToTzSpecificLocalTime&quot;
    c_SystemTimeToTzSpecificLocalTime :: Ptr TIME_ZONE_INFORMATION -&gt; Ptr SYSTEMTIME -&gt; Ptr SYSTEMTIME -&gt; IO BOOL
systemTimeToTzSpecificLocalTime :: TIME_ZONE_INFORMATION -&gt; SYSTEMTIME -&gt; IO SYSTEMTIME
systemTimeToTzSpecificLocalTime tzi st = with tzi $ \tzi -&gt; with st $ \st -&gt; alloca $ \res -&gt; do
    failIf not &quot;systemTimeToTzSpecificLocalTime: SystemTimeToTzSpecificLocalTime&quot; $
        c_SystemTimeToTzSpecificLocalTime tzi st res
    peek res

foreign import WINDOWS_CCONV &quot;windows.h TzSpecificLocalTimeToSystemTime&quot;
    c_TzSpecificLocalTimeToSystemTime :: Ptr TIME_ZONE_INFORMATION -&gt; Ptr SYSTEMTIME -&gt; Ptr SYSTEMTIME -&gt; IO BOOL
tzSpecificLocalTimeToSystemTime :: TIME_ZONE_INFORMATION -&gt; SYSTEMTIME -&gt; IO SYSTEMTIME
tzSpecificLocalTimeToSystemTime tzi st = with tzi $ \tzi -&gt; with st $ \st -&gt; alloca $ \res -&gt; do
    failIf not &quot;tzSpecificLocalTimeToSystemTime: TzSpecificLocalTimeToSystemTime&quot; $
        c_TzSpecificLocalTimeToSystemTime tzi st res
    peek res
-}</span><span>
</span><span id="line-352"></span><span>
</span><span id="line-353"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h QueryPerformanceFrequency&quot;</span><span>
</span><span id="line-354"></span><span>    </span><span class="hs-identifier">c_QueryPerformanceFrequency</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">LARGE_INTEGER</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">BOOL</span><span>
</span><span id="line-355"></span><span class="hs-identifier">queryPerformanceFrequency</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Integer</span><span>
</span><span id="line-356"></span><span class="hs-identifier">queryPerformanceFrequency</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">res</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-357"></span><span>    </span><span class="hs-identifier">failIf_</span><span> </span><span class="hs-identifier">not</span><span> </span><span class="hs-string">&quot;queryPerformanceFrequency: QueryPerformanceFrequency&quot;</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-358"></span><span>        </span><span class="hs-identifier">c_QueryPerformanceFrequency</span><span> </span><span class="hs-identifier">res</span><span>
</span><span id="line-359"></span><span>    </span><span class="hs-identifier">liftM</span><span> </span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">res</span><span>
</span><span id="line-360"></span><span>
</span><span id="line-361"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h QueryPerformanceCounter&quot;</span><span>
</span><span id="line-362"></span><span>    </span><span class="hs-identifier">c_QueryPerformanceCounter</span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">LARGE_INTEGER</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">BOOL</span><span>
</span><span id="line-363"></span><span class="hs-identifier">queryPerformanceCounter</span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">Integer</span><span>
</span><span id="line-364"></span><span class="hs-identifier">queryPerformanceCounter</span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">alloca</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">res</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-365"></span><span>    </span><span class="hs-identifier">failIf_</span><span> </span><span class="hs-identifier">not</span><span> </span><span class="hs-string">&quot;queryPerformanceCounter: QueryPerformanceCounter&quot;</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-366"></span><span>        </span><span class="hs-identifier">c_QueryPerformanceCounter</span><span> </span><span class="hs-identifier">res</span><span>
</span><span id="line-367"></span><span>    </span><span class="hs-identifier">liftM</span><span> </span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">peek</span><span> </span><span class="hs-identifier">res</span><span>
</span><span id="line-368"></span><span>
</span><span id="line-369"></span><span class="hs-keyword">type</span><span> </span><span class="hs-identifier">GetTimeFormatFlags</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">DWORD</span><span>
</span><span id="line-370"></span><span class="hs-identifier">lOCALE_NOUSEROVERRIDE</span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">GetTimeFormatFlags</span><span>
</span><span id="line-371"></span><span class="hs-identifier">lOCALE_NOUSEROVERRIDE</span><span>  </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">2147483648</span><span>
</span><span id="line-372"></span><span class="hs-identifier">lOCALE_USE_CP_ACP</span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">GetTimeFormatFlags</span><span>
</span><span id="line-373"></span><span class="hs-identifier">lOCALE_USE_CP_ACP</span><span>      </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">1073741824</span><span>
</span><span id="line-374"></span><span class="hs-identifier">tIME_NOMINUTESORSECONDS</span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">GetTimeFormatFlags</span><span>
</span><span id="line-375"></span><span class="hs-identifier">tIME_NOMINUTESORSECONDS</span><span>  </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">1</span><span>
</span><span id="line-376"></span><span class="hs-identifier">tIME_NOSECONDS</span><span>         </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">GetTimeFormatFlags</span><span>
</span><span id="line-377"></span><span class="hs-identifier">tIME_NOSECONDS</span><span>         </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">2</span><span>
</span><span id="line-378"></span><span class="hs-identifier">tIME_NOTIMEMARKER</span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">GetTimeFormatFlags</span><span>
</span><span id="line-379"></span><span class="hs-identifier">tIME_NOTIMEMARKER</span><span>      </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">4</span><span>
</span><span id="line-380"></span><span class="hs-identifier">tIME_FORCE24HOURFORMAT</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">GetTimeFormatFlags</span><span>
</span><span id="line-381"></span><span class="hs-identifier">tIME_FORCE24HOURFORMAT</span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="hs-number">8</span><span>
</span><span id="line-382"></span><span>
</span><span id="line-383"></span><span class="hs-pragma">{-# LINE 378 &quot;libraries\\Win32\\System\\Win32\\Time.hsc&quot; #-}</span><span>
</span><span id="line-378"></span><span>
</span><span id="line-379"></span><span class="hs-identifier">getTimeFormatEx</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-380"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">GetTimeFormatFlags</span><span>
</span><span id="line-381"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span>
</span><span id="line-382"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-383"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-384"></span><span class="hs-identifier">getTimeFormatEx</span><span> </span><span class="hs-identifier">locale</span><span> </span><span class="hs-identifier">flags</span><span> </span><span class="hs-identifier">st</span><span> </span><span class="hs-identifier">fmt</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-385"></span><span>    </span><span class="hs-identifier">maybeWith</span><span> </span><span class="hs-identifier">withTString</span><span> </span><span class="hs-identifier">locale</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">c_locale</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-386"></span><span>        </span><span class="hs-identifier">maybeWith</span><span> </span><span class="hs-identifier">with</span><span> </span><span class="hs-identifier">st</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">c_st</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-387"></span><span>            </span><span class="hs-identifier">maybeWith</span><span> </span><span class="hs-identifier">withTString</span><span> </span><span class="hs-identifier">fmt</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">c_fmt</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-388"></span><span>                </span><span class="hs-keyword">let</span><span> </span><span class="hs-identifier">c_func</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">c_GetTimeFormatEx</span><span> </span><span class="hs-identifier">c_locale</span><span> </span><span class="hs-identifier">flags</span><span> </span><span class="hs-identifier">c_st</span><span> </span><span class="hs-identifier">c_fmt</span><span>
</span><span id="line-389"></span><span>                </span><span class="hs-identifier">trySized</span><span> </span><span class="hs-string">&quot;GetTimeFormatEx&quot;</span><span> </span><span class="hs-identifier">c_func</span><span>
</span><span id="line-390"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h GetTimeFormatEx&quot;</span><span>
</span><span id="line-391"></span><span>    </span><span class="hs-identifier">c_GetTimeFormatEx</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LPCWSTR</span><span>
</span><span id="line-392"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">GetTimeFormatFlags</span><span>
</span><span id="line-393"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span>
</span><span id="line-394"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCWSTR</span><span>
</span><span id="line-395"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPWSTR</span><span>
</span><span id="line-396"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">CInt</span><span>
</span><span id="line-397"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">CInt</span><span>
</span><span id="line-398"></span><span>
</span><span id="line-399"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-string">&quot;windows.h GetTimeFormatW&quot;</span><span>
</span><span id="line-400"></span><span>    </span><span class="hs-identifier">c_GetTimeFormat</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LCID</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">GetTimeFormatFlags</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Ptr</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPCTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">LPTSTR</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">CInt</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">CInt</span><span>
</span><span id="line-401"></span><span class="hs-identifier">getTimeFormat</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">LCID</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">GetTimeFormatFlags</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">SYSTEMTIME</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">Maybe</span><span> </span><span class="hs-identifier">String</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">String</span><span>
</span><span id="line-402"></span><span class="hs-identifier">getTimeFormat</span><span> </span><span class="hs-identifier">locale</span><span> </span><span class="hs-identifier">flags</span><span> </span><span class="hs-identifier">st</span><span> </span><span class="hs-identifier">fmt</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-403"></span><span>    </span><span class="hs-identifier">maybeWith</span><span> </span><span class="hs-identifier">with</span><span> </span><span class="hs-identifier">st</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">c_st</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-404"></span><span>    </span><span class="hs-identifier">maybeWith</span><span> </span><span class="hs-identifier">withCWString</span><span> </span><span class="hs-identifier">fmt</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">c_fmt</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-405"></span><span>        </span><span class="hs-identifier">size</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">c_GetTimeFormat</span><span> </span><span class="hs-identifier">locale</span><span> </span><span class="hs-identifier">flags</span><span> </span><span class="hs-identifier">c_st</span><span> </span><span class="hs-identifier">c_fmt</span><span> </span><span class="hs-identifier">nullPtr</span><span> </span><span class="hs-number">0</span><span>
</span><span id="line-406"></span><span>        </span><span class="hs-identifier">allocaBytes</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-identifier">size</span><span class="hs-special">)</span><span> </span><span class="hs-operator">*</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">sizeOf</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">undefined</span><span class="hs-glyph">::</span><span class="hs-identifier">CWchar</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-glyph">\</span><span class="hs-identifier">out</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-407"></span><span>            </span><span class="hs-identifier">size'</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-identifier">failIf</span><span> </span><span class="hs-special">(</span><span class="hs-operator">==</span><span class="hs-number">0</span><span class="hs-special">)</span><span> </span><span class="hs-string">&quot;getTimeFormat: GetTimeFormat&quot;</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-408"></span><span>                </span><span class="hs-identifier">c_GetTimeFormat</span><span> </span><span class="hs-identifier">locale</span><span> </span><span class="hs-identifier">flags</span><span> </span><span class="hs-identifier">c_st</span><span> </span><span class="hs-identifier">c_fmt</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">castPtr</span><span> </span><span class="hs-identifier">out</span><span class="hs-special">)</span><span> </span><span class="hs-identifier">size</span><span>
</span><span id="line-409"></span><span>            </span><span class="hs-identifier">peekTStringLen</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">out</span><span class="hs-special">,</span><span class="hs-identifier">fromIntegral</span><span> </span><span class="hs-identifier">size'</span><span class="hs-special">)</span><span>
</span><span id="line-410"></span></pre></body></html>